package com.tasly.manager.impl;

import com.tasly.dao.CarDao;
import com.tasly.dao.UserDao;
import com.tasly.manager.CarUserManager;
import com.tasly.model.bo.UsersCarsBO;
import com.tasly.model.entity.CarDO;
import com.tasly.model.entity.UserDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarUserManagerImpl implements CarUserManager {
    @Autowired
    private UserDao userDao;
    @Autowired
    private CarDao carDao;
    @Override
    public UsersCarsBO getUserCar() {
        List<UserDO> userDOS = userDao.selectList(null);
        List<CarDO> carDOS = carDao.selectList(null);
        UsersCarsBO usersCarsBO = new UsersCarsBO();
        usersCarsBO.setUsers(userDOS);
        usersCarsBO.setCars(carDOS);
        return usersCarsBO;
    }
}
